package cn.xcyy.itcc.crontab;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class PublishSeckillTask {


    private Integer time = 0;

    @Scheduled(cron = "0 0 4 * * ?")   //定时器定义，设置执行时间
    private void process() {
        System.out.println("定时器1执行" + time++);
    }

//    @Scheduled(fixedDelay = 1 * 1000)   //定时器定义，设置执行时间 1s
//    private void process1() {
//        System.out.println("定时器2执行" + time++);
//    }


}
